import Vue from 'vue'
import App from './App.vue'
import router from './router.js'
import store from './store'
import axios from 'axios'
import VueAxios from 'vue-axios'
import VueCookies from 'vue-cookie'
import vueLazy from 'vue-lazyload'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import VueAwesomeSwiper from "vue-awesome-swiper";
import 'swiper/css/swiper.css'
import '@/assets/reset.css'
import './assets/iconfont/iconfont.css'

Vue.use(VueAwesomeSwiper)
Vue.config.productionTip = false
Vue.use(VueAxios, axios)
Vue.use(VueCookies)
Vue.use(ElementUI);
Vue.use(vueLazy,{
  loading:"/imgs/loading-svg/loading-bubbles.svg"
})

// console.log(ElementUI)
axios.defaults.baseURL = '/api';
axios.interceptors.response.use(response => {
  let res = response.data;
  if(res.status == "0"){
    return res.data;
  }else if(res.status == '1'){
    // if(res.msg){
    //   this.$message(res.msg);
    // }
    return Promise.reject(res);
  }
},() => {
  // this.$message("出错了")
  return
});


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
